package com.block.datapush.service.apipush.utils;

import cn.hutool.core.util.StrUtil;
import com.block.common.enums.BaseTypeInfoEnum;

/**
 * 51公积金双授权
 */
public class WuYiGongJiJinUtil {

    public static String getSex(Integer sex) {
        if (sex != 2) {
            return "男";
        }
        return "女";
    }

    public static Integer getGjj(String gongjijin) {
        if (StrUtil.equals(BaseTypeInfoEnum.Gjj.gjj001.getValue(), gongjijin)) {
            return 0;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Gjj.gjj002.getValue(), gongjijin)){
            return 1;
        }
        return 2;
    }

    public static Integer getSheBao(String shebao) {
        if (StrUtil.equals(BaseTypeInfoEnum.Shebao.sb001.getValue(), shebao)) {
            return 0;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Shebao.sb002.getValue(), shebao)){
            return 1;
        }
        return 2;
    }

    public static Integer getHouse(String house) {
        if (StrUtil.equals(BaseTypeInfoEnum.House.hu001.getValue(), house) || StrUtil.equals(BaseTypeInfoEnum.House.hu002.getValue(), house)) {
            return 0;
        }
        return 1;
    }

    public static Integer getCar(String car) {
        if (StrUtil.equals(BaseTypeInfoEnum.Car.car001.getValue(), car)) {
            return 0;
        }
        return 1;
    }

    public static Integer getZhimaScore(String zhima) {
        if (StrUtil.equals(BaseTypeInfoEnum.Zhima.zm001.getValue(), zhima) || StrUtil.equals(BaseTypeInfoEnum.Zhima.zm002.getValue(), zhima)) {
            return 1;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Zhima.zm003.getValue(), zhima)) {
            return 3;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Zhima.zm004.getValue(), zhima)) {
            return 5;
        }
        return 7;
    }

    public static Integer getBaoxian(String baoxian) {
        if (StrUtil.equals(BaseTypeInfoEnum.Baoxian.bx001.getValue(), baoxian)) {
            return 0;
        }
        return 1;
    }

    public static Integer getGongzuo(String gongzuo) {
        if (StrUtil.equals(BaseTypeInfoEnum.Gongzuo.gz001.getValue(), gongzuo)) {
            return 1;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Gongzuo.gz004.getValue(), gongzuo)) {
            return 2;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Gongzuo.gz003.getValue(), gongzuo)) {
            return 3;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Gongzuo.gz002.getValue(), gongzuo)) {
            return 4;
        }
        return 99;
    }

    public static Integer getXueli(String xueli) {
        if (StrUtil.equals(BaseTypeInfoEnum.XueLi.xl004.getValue(), xueli) || StrUtil.equals(BaseTypeInfoEnum.XueLi.xl005.getValue(), xueli)) {
            return 1;
        }else if (StrUtil.equals(BaseTypeInfoEnum.XueLi.xl003.getValue(), xueli)) {
            return 2;
        }
        return 5;
    }

    public static Integer getXinyongka(String xinyongka) {
        if (StrUtil.equals(BaseTypeInfoEnum.XinYongKa.xyk001.getValue(), xinyongka)) {
            return 0;
        }
        return 99;
    }

    public static Integer getYuqi(String yuqi) {
        if (StrUtil.equals(BaseTypeInfoEnum.Yuqi.yq001.getValue(), yuqi)) {
            return 1;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Yuqi.yq002.getValue(), yuqi)) {
            return 3;
        }
        return 4;
    }

    public static Integer getShouru(String shouru) {
        if (StrUtil.equals(BaseTypeInfoEnum.Shouru.sr001.getValue(), shouru)) {
            return 2500;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Shouru.sr002.getValue(), shouru)) {
            return 5000;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Shouru.sr003.getValue(), shouru)) {
            return 10000;
        }
        return 20000;
    }

    public static Integer getloan(String loan) {
        if (StrUtil.equals(BaseTypeInfoEnum.LoanAmount.la001.getValue(), loan)) {
            return 10000;
        } else if (StrUtil.equals(BaseTypeInfoEnum.LoanAmount.la002.getValue(), loan)) {
            return 30000;
        }else if (StrUtil.equals(BaseTypeInfoEnum.LoanAmount.la003.getValue(), loan)) {
            return 50000;
        }else if (StrUtil.equals(BaseTypeInfoEnum.LoanAmount.la004.getValue(), loan)) {
            return 100000;
        }
        return 200000;
    }

    public static Integer getloantime(String loantime) {
         if (StrUtil.equals(BaseTypeInfoEnum.LoanTime.lt001.getValue(), loantime) || StrUtil.equals(BaseTypeInfoEnum.LoanTime.lt002.getValue(), loantime)) {
            return 3;
        }else if (StrUtil.equals(BaseTypeInfoEnum.LoanTime.lt003.getValue(), loantime)) {
            return 6;
        }
        return 12;
    }

    public static Integer getYongtu(String yongtu) {
        if (StrUtil.equals(BaseTypeInfoEnum.Yongtu.yt002.getValue(), yongtu)) {
            return 1;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Yongtu.yt001.getValue(), yongtu)) {
            return 3;
        }if (StrUtil.equals(BaseTypeInfoEnum.Yongtu.yt005.getValue(), yongtu)) {
            return 4;
        }if (StrUtil.equals(BaseTypeInfoEnum.Yongtu.yt003.getValue(), yongtu)) {
            return 5;
        }if (StrUtil.equals(BaseTypeInfoEnum.Yongtu.yt004.getValue(), yongtu)) {
            return 6;
        }
        return 99;
    }

    public static String getReqip(String reqip) {
        if (StrUtil.isNotEmpty(reqip)){
            return reqip;
        }
        return "0.0.0.0";
    }









}
